// 公共接口相关的mock数据
import { mock, Random } from 'mockjs'

// 获取系统配置
export const getConfig = mock({
  'code': 1,
  'msg': '操作成功',
  'data': {
    'config': {
      'sitename': 'CMS内容管理系统',
      'sitelogo': '@image("200x50", "#4A7BF7", "CMS")',
      'siteurl': 'http://www.example.com',
      'title': 'CMS内容管理系统 - 专业的内容管理系统',
      'keywords': 'CMS,内容管理系统,FastAdmin',
      'description': 'CMS内容管理系统是一款基于FastAdmin的内容管理系统，提供更完善的内容管理功能。',
      'theme': 'default',
      'qrcode': '@image("200x200", "#4A7BF7", "QR")',
      'wxapp': {
        'appid': 'wx123456789',
        'app_secret': 'abcdefghijklmn',
        'backgroundimage': '@image("750x1334", "#4A7BF7", "BG")',
        'navigationBarBackgroundColor': '#4A7BF7',
        'navigationBarTextStyle': 'white',
        'navigationBarTitleText': 'CMS内容管理系统',
        'backgroundColor': '#f8f8f8',
        'backgroundTextStyle': 'dark'
      },
      'categorytype': {
        'article': '文章',
        'product': '产品',
        'download': '下载',
        'news': '新闻'
      },
      'pagetypeList': {
        'page': '单页',
        'list': '列表',
        'channel': '栏目',
        'link': '链接'
      },
      'archivesratio': '16:9',
      'searchtype': 'all',
      'autopinyin': 1,
      'userpage': 1,
      'loadmode': 'infinite',
      'pagemode': 'full',
      'pagesize': 10,
      'archiveshashids': 1,
      'hashids_key_length': 10,
      'channelallocate': 1,
      'archiveschoose': 1,
      'specialchoose': 1,
      'pagechoose': 1,
      'tagchoose': 1,
      'upload': {
        'cdnurl': 'http://example.com',
        'uploadurl': 'http://example.com/upload',
        'bucket': 'yourbucket',
        'maxsize': '10mb',
        'mimetype': '*',
        'multipart': {
          'policy': 'eyJleHBpcmF0aW9uIjoiMjAyMC0wMS0wMVQwMDowMDowMC4wMDBaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF1dfQ==',
          'signature': 'da39a3ee5e6b4b0d3255bfef95601890afd80709',
          'OSSAccessKeyId': 'LTAI4Fd1oDKR4aP1kYCpuDu4',
          'success_action_status': '200'
        }
      },
      'usersidenav': 'archives,comment,collection',
      'openedsite': 'uniapp,wxapp,h5,app',
      'isarchivesaudit': 0,
      'score': {
        'postarchives': 1,
        'postcomment': 1
      },
      'limitscore': {
        'postarchives': 0,
        'postcomment': 0
      }
    },
    'userInfo': {
      'id': '@integer(1, 100)',
      'username': '@word(5, 10)',
      'nickname': '@cname',
      'mobile': '1@string("number", 10)',
      'avatar': '@image("100x100", "#4A7BF7", "Avatar")',
      'score': '@integer(0, 10000)',
      'money': '@float(0, 10000, 2, 2)',
      'gender': '@integer(0, 2)',
      'birthday': '@date("yyyy-MM-dd")',
      'bio': '@cparagraph(1)',
      'email': '@email',
      'level': '@integer(1, 10)',
      'vip': '@integer(0, 3)',
      'viptime': '@integer(1600000000, 1630000000)',
      'createtime': '@integer(1600000000, 1630000000)',
      'balance': '@float(0, 10000, 2, 2)'
    },
    'token': '@guid'
  }
})

// 获取验证码
export const getCaptcha = mock({
  'code': 1,
  'msg': '操作成功',
  'data': {
    'captcha': '@image("150x40", "#4A7BF7", "1234")',
    'key': '@guid'
  }
})

// 获取分类
export const getCategory = mock({
  'code': 1,
  'msg': '操作成功',
  'data': {
    'categoryList|10': [{
      'id': '@id',
      'pid': '@integer(0, 5)',
      'name': '@cword(2, 4)',
      'image': '@image("100x100", "#4A7BF7", "CMS")',
      'flag': '@pick(["hot", "new", "recommend"])',
      'diyname': '@word(5, 10)',
      'createtime': '@integer(1600000000, 1630000000)',
      'updatetime': '@integer(1600000000, 1630000000)',
      'status': 'normal',
      'weigh': '@integer(0, 100)',
      'type': '@pick(["article", "product", "download", "news"])'
    }]
  }
})

// 下拉选择
export const selectPage = mock({
  'code': 1,
  'msg': '操作成功',
  'data': {
    'total': '@integer(10, 100)',
    'list|10': [{
      'id': '@id',
      'name': '@cword(2, 8)'
    }]
  }
})